// 组合继承
function Person({ age, name }) {
    this.age = age;
    this.name = name
}

Person.prototype.say = function () {
    console.log('hello')
}

function Person1(obj) {
    Person.call(this, obj)
    this.sex = 'woman';
}

Person1.prototype = new Person();

// 寄生组合继承
function Person2({ age, name }) {
    this.age = age;
    this.name = name
}

Person2.prototype.say = function () {
    console.log('hello')
}

function Person3(obj) {
    Person.call(this, obj)
    this.sex = 'woman';
}

Person3.prototype = Object.create(Person2.prototype);
Person3.prototype.constructor = Person3;

class Person4 {
    constructor(obj) {
        this.name = obj.name
    }
}

class Person5 extends Person4 {
    constructor(obj) {
        super(obj)
    }
}


